﻿using AutoMapper;
using DncLite.Application.ViewModels.Student;
using DncLite.Domain.Models;

namespace DncLite.Application.AutoMapper
{
    internal class DomainToViewModelMappingProfile : Profile
    {
        public DomainToViewModelMappingProfile()
        {
            CreateMap<Student, StudentViewModel>()
                .ForMember(d=>d.Province,o=>o.MapFrom(s=>s.Address.Province))
                .ForMember(d => d.City, o => o.MapFrom(s => s.Address.City))
                .ForMember(d => d.County, o => o.MapFrom(s => s.Address.County))
                .ForMember(d => d.Street, o => o.MapFrom(s => s.Address.Street));
        }
    }
}